package inventory.controller;

import inventory.common.ResultData;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

/**
 * @author sxt
 * @create 2019-11-08 21:34
 */

@ControllerAdvice
public class ExceptionController {

    @ExceptionHandler
    @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
    @ResponseBody
    public ResultData handleDefaultException(Exception e){
        e.printStackTrace();

        return new ResultData().FAILD().setObjs(e.getMessage());
    }

}
